home *** CD-ROM | disk | FTP | other *** search
Wrap
<?xml version="1.0" encoding="iso-8859-1"?> <dialog width="430" height="250" caption="Button"> <controls> <panel name="mainpanel" caption="" align="alclient" bevelinner="bvnone" bevelouter="bvnone"> <label name="lblValue" caption="Text/value" hint="Text/value of your form element." width="69" height="13" top="8" left="208"/> <label name="lblName" caption="Name" hint="The name of this element. Important if you wish to refer to this form element through some sort of scripting for instance. This field is required." width="29" height="13" top="8" left="8"/> <edit name="edtValue" taborder="1" text="" hint="Text/value of your form element." width="175" height="19" top="24" left="208"/> <edit name="edtName" taborder="0" text="" hint="The name of this element. Important if you wish to refer to this form element through some sort of scripting for instance. This field is required." width="175" height="19" top="24" left="8"/> <checkbox name="cbDisabled" caption="Disabled" taborder="2" hint="Your element will be visible, but disabled." checked="0" width="121" height="17" top="56" left="8"/> </panel> </controls> <dialogevents> <event type="onclose" resulttype="ok"> StartCode := ('<input type="button"'); if edtName.Text <> '' then StartCode := StartCode + (' name="'+(edtName.Text)+'"'); if edtValue.Text <> '' then StartCode := StartCode + ' value="'+edtValue.Text+'"'; if cbDisabled.Checked then StartCode := StartCode + (' disabled'); If edtCSSClass.Text <> '' then StartCode := StartCode + ' class="'+edtCSSClass.Text+'"'; If edtCSSId.Text <> '' then StartCode := StartCode + ' ID="'+edtCSSId.Text+'"'; If edtCSSStyle.Text <> '' then StartCode := StartCode + ' style="'+edtCSSStyle.Text+'"'; for i := 0 to EventGrid.Count - 1 do begin if EventGrid.Rows[i].EditText <> '' then StartCode := StartCode + ' ' + (EventGrid.Rows[i].Caption+'="' + EventGrid.Rows[i].EditText)+'"'; end; StartCode := StartCode + '>'; If cbMakeXHTMLCompliant.Checked then StartCode := MakeXHTMLCompliant(StartCode, false); If cbDoPHPEscape.Checked then StartCode := DoPHPEscape(StartCode); // A little "hack" - WebCoder will set this, to let us know whether to update // an existing tag, or insert a brand new one If cbUpdateExistingTag.Checked then ReplaceTag(StartCode) else InsertTags(StartCode, ''); </event> <event type="onshow"> // Lets put the advanced panel in the right place pnlAdvanced.Parent := MainPanel; pnlAdvanced.Left := 8; pnlAdvanced.Top := MainPanel.Height - 32; pnlAdvanced.Width := Self.Width - 36; // Height of the panel will be set internally. Do we need to make the dialog higher to make room for the Advanced panel? If pnlAdvanced.Height > 20 then Self.Height := Self.Height + 200; </event> <event type="updatedialog"> // This event will be called when a user executes the "Edit current tag"-rightclick feature // The entire selected tag will be passed as a parameter to this function, that should update // the required fields of the dialog. function UpdateDialog(Tag: string); begin edtName.Text := GetValueFromAttribute(Tag, 'name'); edtValue.Text := GetValueFromAttribute(Tag, 'value'); cbDisabled.Checked := HasOption(Tag, 'disabled'); edtCSSClass.Text := GetValueFromAttribute(Tag, 'class'); edtCSSId.Text := GetValueFromAttribute(Tag, 'id'); edtCSSStyle.Text := GetValueFromAttribute(Tag, 'style'); for i := 0 to EventGrid.Count - 1 do begin EventVal := GetValueFromAttribute(Tag, Lowercase(EventGrid.Rows[i].Caption)); If EventVal <> '' then EventGrid.Rows[i].EditText := EventVal; end; cbDoPHPEscape.Checked := IsPHPEscaped(Tag); cbMakeXHTMLCompliant.Checked := isXHTMLDocument(); end; </event> </dialogevents> </dialog>